<!--车辆处置页面-->
<template>
  <div>
    <el-dialog title="详情" :visible.sync="dialogVisible" width="80%" v-if="formData" @close="close">
      <el-form :model="formData" label-width="150px" ref="form">
        <el-row>
          <el-col :sm="12">
            <el-form-item label="申请人单位">{{formData.company.companyName}}</el-form-item>
          </el-col>
          <el-col :sm="12">
            <el-form-item label="使用类型">{{formData.useType}}</el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :sm="12">
            <el-form-item label="配备方式">{{formData.clname}}</el-form-item>
          </el-col>
          <el-col :sm="12">
            <el-form-item label="车辆类型">{{formData.carType}}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :sm="24">
            <el-form-item label="申请原因">{{formData.reason}}</el-form-item>
          </el-col>
        </el-row>

        <el-row v-if="formData.clname=='新购'">
          <el-col :sm="24">
            <el-form-item label="预算指标文件号">{{formData.ysno}}</el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :sm="24">
            <el-form-item label="附件" style="color:red;">
              <a @click="download(formData.fileurl1,formData.filename1)">{{formData.filename1}}</a>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row v-if="formData.clname=='新购'">
          <el-col :sm="24">
            <el-form-item label="财政预算指标文件" style="color:red;">
              <a @click="download(formData.fileurl2,formData.filename2)">{{formData.filename2}}</a>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-form-item label="历史流程">
            <el-table :data="history" style="width: 100%" size="mini" border>
              <el-table-column prop="taskName" label="步骤" align="center"></el-table-column>
              <el-table-column prop="userName" label="审核人" align="center"></el-table-column>
              <el-table-column prop="mobile" label="电话" align="center"></el-table-column>
              <el-table-column prop="mark" label="审批意见" align="center"></el-table-column>
              <el-table-column prop="passStr" label="状态" align="center"></el-table-column>
              <el-table-column prop="optime" label="操作时间" align="center"></el-table-column>
            </el-table>
          </el-form-item>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer" style="text-align: left;">
        <el-button @click="close">关闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { viewJson } from "@/api/task";
import { dateFormat } from "@/utils/utils";
export default {
  data() {
    return {
      pass: 1,
      opData: null,
      history: [],
      formData: null,
      dialogVisible: false,
    };
  },
  created() {
    this.webUploadUrl = this.VUE_APP_BASE_API + "/common/webupload.shtml";
  },
  methods: {
    close() {
      this.dialogVisible = false;
    },
    /**
     * @description 查看任务
     * @param opData 当前操作的任务原始数据 list接口返回的
     */
    async viewTask(opData) {
      this.opData = opData;
      let params = {
        tableId: opData.id,
        pid: opData.prcid,
        // taskId: opData.taskId,
        formKey: "carpb_ss",
      };
      let taskDetail = await viewJson(params);
      this.formData = taskDetail.data;
      this.history.splice(0, this.history.length, ...taskDetail.history);
      this.dialogVisible = true;
    },
  },
};
</script>
<style lang="scss" scoped>
.el-timeline {
  position: relative;
  top: -25px;
  left: 110px;
  margin-bottom: -45px;
}
</style>
<style lang="scss">
.upload-mini {
  .el-upload-dragger {
    height: 50px;
    line-height: 50px;
  }
}

.upload-mini + .el-form-item__error {
  position: relative;
  top: -15px;
}
</style>
<style lang="scss" scoped>
.el-timeline {
  position: relative;
  top: -55px;
  left: 110px;
  margin-bottom: -45px;
}
</style>